
/* <<< COPYRIGHT START >>>
 * Copyright 2006-Present OxygenSoftwareLibrary.com
 * Licensed under the GNU Lesser General Public License.
 * http://www.gnu.org/licenses/lgpl.html
 * 
 * @author: Ugorji Dick-Nwoke
 * <<< COPYRIGHT END >>>
 */


package oxygen.forum.data;

import javax.persistence.*;

@Entity
@Table(name="oxyforum_post", uniqueConstraints=@UniqueConstraint(columnNames="f_topic_id, f_date"))
@Inheritance(strategy=InheritanceType.JOINED)
public class Post extends PostEntity {
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name="f_id", nullable=false)
  private Long id;
  
  @ManyToOne(cascade=CascadeType.ALL)
  @JoinColumn(name="f_topic_id", nullable=false)
  private Topic topic;

  public Long getId() {
    return id;
  }
  public void setId(Long id) {
    this.id = id;
  }
  public Topic getTopic() {
    return topic;
  }
  public void setTopic(Topic topic) {
    this.topic = topic;
  }

}

